
#region Imports

using System;
using System.Collections.Generic;
using System.Text;

#endregion

namespace Justa.Mock
{
    /// <summary>
    /// 
    /// </summary>
    /// 
    public class MockAspect
    {
        /// <summary>
        /// 
        /// </summary>
        /// 
        public static void BeforeAdvice()
        {
            Console.WriteLine("Executing before advice...");
        }

        /// <summary>
        /// 
        /// </summary>
        /// 
        /// <param name="returnValue"></param>
        /// 
        public static void AfterAdvice(object returnValue)
        {
            Console.WriteLine("Return value from executing after advice: {0}.", returnValue);
        }

        /// <summary>
        /// 
        /// </summary>
        /// 
        /// <param name="method"></param>
        /// <param name="args"></param>
        /// 
        /// <returns></returns>
        /// 
        public static object AroundAdvice(Justa.Aspect.JoinPoint point)
        {
            Console.WriteLine("Executing before around advice...");
            object result = point.Proceed();
            Console.WriteLine("Executing after around advice...");
            return result;
        }

        /// <summary>
        /// 
        /// </summary>
        /// 
        /// <param name="exception"></param>
        /// 
        public static void AfterThrowsAdvice(Exception exception)
        {
            Console.WriteLine("Captured exception: {0}.", exception.Message);
        }

        /// <summary>
        /// 
        /// </summary>
        /// 
        /// <param name="returnValue"></param>
        /// 
        public static void GenericAfterAdvice(string returnValue)
        {
            Console.WriteLine("Return value from executing after advice: {0}.", returnValue);
        }
    }
}
